USE [Escuela];
GO
IF OBJECT_ID ( 'dbo.coop_cierre_mensual_Get_By_Date', 'P' ) IS NOT NULL 
    DROP PROCEDURE dbo.coop_cierre_mensual_Get_By_Date
GO
CREATE PROCEDURE dbo.coop_cierre_mensual_Get_By_Date 
    @month int, 
    @year int 
AS 
    
SELECT 
[id],
[diferencia],
[fecha],
[monto_total],
[observacion]
FROM [dbo].[cierre_diario] cd
WHERE (DATEPART (MM, cd.fecha) = @month) AND (DATEPART (YYYY, cd.fecha) = @year)

GO

